<?php

class stToolBarFunctions extends stfunctions_2_1 {

    public function __construct($config) {
        parent::__construct($config);
    }

    public function customEditor($content='test', $editor_id = 'content') {
        ?>
        <div id="poststuff" class="metabox-holder" style="width:650px;">
            <div id="editorcontainer">
                <div id="<?php echo $editor_id ?>">
                    <?php wp_editor($content, "data[{$editor_id}]", array('dfw' => false, 'tabindex' => 1)) ?>
                </div>
            </div>
            <br class="clear" />
        </div>
        <script type="text/javascript">
            var id = '#<?php echo $editor_id ?>';
            var form = jQuery(id).parents('form').attr('id');
            form = '#'+form;
            jQuery(form).submit(function() {
                tinyMCE.triggerSave();
            });
        </script>
        <?php
    }

}
?>